package cn.com.scitc.licenseplateback.model;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "NationalTreasury", schema = "CubeLibrary", catalog = "")
public class NationalTreasuryEntity {
    private int autoNumber;
    private int cityCode;
    private String cubeLibraryNumber;
    private String cubeLibraryAddress;



    @Id
    @Column(name = "AutoNumber", nullable = false)
    public int getAutoNumber() {
        return autoNumber;
    }

    public void setAutoNumber(int autoNumber) {
        this.autoNumber = autoNumber;
    }

    @Basic
    @Column(name = "CityCode", nullable = false)
    public int getCityCode() {
        return cityCode;
    }

    public void setCityCode(int cityCode) {
        this.cityCode = cityCode;
    }

    @Basic
    @Column(name = "CubeLibraryNumber", nullable = true, length = 32)
    public String getCubeLibraryNumber() {
        return cubeLibraryNumber;
    }

    public void setCubeLibraryNumber(String cubeLibraryNumber) {
        this.cubeLibraryNumber = cubeLibraryNumber;
    }

    @Basic
    @Column(name = "CubeLibraryAddress", nullable = true, length = 100)
    public String getCubeLibraryAddress() {
        return cubeLibraryAddress;
    }

    public void setCubeLibraryAddress(String cubeLibraryAddress) {
        this.cubeLibraryAddress = cubeLibraryAddress;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        NationalTreasuryEntity that = (NationalTreasuryEntity) o;
        return autoNumber == that.autoNumber &&
                cityCode == that.cityCode &&
                Objects.equals(cubeLibraryNumber, that.cubeLibraryNumber) &&
                Objects.equals(cubeLibraryAddress, that.cubeLibraryAddress);
    }

    @Override
    public int hashCode() {
        return Objects.hash(autoNumber, cityCode, cubeLibraryNumber, cubeLibraryAddress);
    }

    @Override
    public String toString() {
        return "NationalTreasuryEntity{" +
                "autoNumber=" + autoNumber +
                ", cityCode=" + cityCode +
                ", cubeLibraryNumber='" + cubeLibraryNumber + '\'' +
                ", cubeLibraryAddress='" + cubeLibraryAddress + '\'' +
                '}';
    }
}
